<template>
	<view class="card" @click="cardClick" :style="{backgroundColor:card.color}">
		<view class="card-icon">
			<text class="iconfont" :class="[card.icon]"></text>
		</view>
		<view class="card-text">
			<text class="text">{{card.text}}</text>
			<text class="english">{{card.english}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			card: Object
		},
		methods: {
			cardClick() {
				if(this.card.page){
					uni.navigateTo({
						url: this.card.page
					})
				}else{
					uni.showToast({
						title:'正在努力开发中...',
						icon:'none'
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card {
		width: 100%;
		display: flex;
		align-items: center;
		padding: 30rpx 0;
		border-radius: 10rpx;
		position: relative;
		background-image: url(/static/images/wave.png);
		background-size: cover;
		background-position: 0% 0%;
		height: 160rpx;
		.card-icon {
			width: 120rpx;
			height: 120rpx;
			flex-shrink: 0;
			display: flex;
			justify-content: center;
			align-items: center;
			border-right: 2rpx solid #fff;

			.iconfont {
				font-size: 64rpx;
				color: #fff;
			}
		}

		.card-text {
			flex: 1;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			color: #fff;

			.text:first-letter {
				font-size: 36rpx;
				margin-right: 4rpx;
				font-weight: 500;
			}

			.text {
				color: #fff;
				margin-bottom: 6rpx;
				font-size: 30rpx;
			}

			.english {
				font-size: 32rpx;
			}
		}


	}

	.card:after {
		content: "";
		position: absolute;
		background-color: inherit;
		width: 100%;
		height: 100%;
		left: 0;
		bottom: -10%;
		border-radius: 10rpx;
		opacity: 0.2;
		transform: scale(0.9, 0.9);
	}
</style>
